package com.example.lin.controller;

import com.example.lin.entity.pojo.User;
import com.example.lin.service.UserService;
import com.example.lin.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 林志豪
 * @since 2024-02-08
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/list")
    @ResponseBody
    public int save(@RequestBody User user) {

        return 0;
    }

    /**
     * 查询所有用户
     */
    @GetMapping("/list")
    @ResponseBody
    public Result list() {
        return Result.ok(userService.list());
    }
}
